package com.allyes.flume.interceptor.rawlogdigger;

/**
 * Created by gc on 7/15/16.
 */
public class DiggerInfoFetcher {
  private String timestamp;
  private String product;
  private String db;

  public DiggerInfoFetcher(com.allyes.log.RawLog rawLog) {
    product = rawLog.getProductName().toString();
    db = rawLog.getDb().toString();
    timestamp = converToMilliSecond(rawLog.getTimestamp());
  }

  public DiggerInfoFetcher(com.allyes.adx.log.RawLog rawLog) {
    product = rawLog.getProductName().toString();
    db = rawLog.getDb().toString();
    timestamp = converToMilliSecond(rawLog.getTimestamp());
  }

  public DiggerInfoFetcher(com.allyes.aim.log.RawLog rawLog) {
    product = rawLog.getProductName().toString();
    db = rawLog.getDb().toString();
    timestamp = converToMilliSecond(rawLog.getTimestamp());
  }

  public String getProduct() {
    return product;
  }

  public String getDb() {
    return db;
  }

  public String getTimeStamp() {
    return timestamp;
  }

  private String converToMilliSecond(Long timestamp_in_second) {
    Long ms = timestamp_in_second * 1000;
    return ms.toString();
  }
}
